#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#

# 通过 dir(a) 可查看内置函数方法 __iter__
# a = "hello"
# b = (1, 2, 3)
# c = [1, 2, 3]
# d = {"aa": 11}
# e = {"aa", "bb"}
# open("a.txt").__next__()
# print(dir(a))
# print(dir(b))
# print(dir(c))
# print(dir(d))
# print(dir(e))

dic = {'a': 1, 'b': 2, 'c': 3}
iter_dic = dic.__iter__()
print(iter_dic, type(iter_dic))
# <dict_keyiterator object at 0x0000020BAF49BB88> <class 'dict_keyiterator'>

print(iter_dic.__next__())
print(iter_dic.__next__())
print(iter_dic.__next__())
# print(iter_dic.__next__())  # StopIteration